/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.engagesoft.cashflow.entidades;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author rchajin
 */
@Entity
@Table(name = "tipo_dinero")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "TipoDinero.findAll", query = "SELECT t FROM TipoDinero t"),
    @NamedQuery(name = "TipoDinero.findByIdTipoDinero", query = "SELECT t FROM TipoDinero t WHERE t.idTipoDinero = :idTipoDinero"),
    @NamedQuery(name = "TipoDinero.findByNombreTipoDinero", query = "SELECT t FROM TipoDinero t WHERE t.nombreTipoDinero = :nombreTipoDinero"),
    @NamedQuery(name = "TipoDinero.findByIndHabilitadotipodinero", query = "SELECT t FROM TipoDinero t WHERE t.indHabilitadotipodinero = :indHabilitadotipodinero")})
public class TipoDinero implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_tipo_dinero")
    private Integer idTipoDinero;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 200)
    @Column(name = "nombre_tipo_dinero")
    private String nombreTipoDinero;
    @Basic(optional = false)
    @NotNull
    @Column(name = "indHabilitado_tipo_dinero")
    private boolean indHabilitadotipodinero;
    @OneToMany(mappedBy = "idTipoDinero")
    private Collection<Documento> documentoCollection;

    public TipoDinero() {
    }

    public TipoDinero(Integer idTipoDinero) {
        this.idTipoDinero = idTipoDinero;
    }

    public TipoDinero(Integer idTipoDinero, String nombreTipoDinero, boolean indHabilitadotipodinero) {
        this.idTipoDinero = idTipoDinero;
        this.nombreTipoDinero = nombreTipoDinero;
        this.indHabilitadotipodinero = indHabilitadotipodinero;
    }

    public Integer getIdTipoDinero() {
        return idTipoDinero;
    }

    public void setIdTipoDinero(Integer idTipoDinero) {
        this.idTipoDinero = idTipoDinero;
    }

    public String getNombreTipoDinero() {
        return nombreTipoDinero;
    }

    public void setNombreTipoDinero(String nombreTipoDinero) {
        this.nombreTipoDinero = nombreTipoDinero;
    }

    public boolean getIndHabilitadotipodinero() {
        return indHabilitadotipodinero;
    }

    public void setIndHabilitadotipodinero(boolean indHabilitadotipodinero) {
        this.indHabilitadotipodinero = indHabilitadotipodinero;
    }

    @XmlTransient
    public Collection<Documento> getDocumentoCollection() {
        return documentoCollection;
    }

    public void setDocumentoCollection(Collection<Documento> documentoCollection) {
        this.documentoCollection = documentoCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idTipoDinero != null ? idTipoDinero.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TipoDinero)) {
            return false;
        }
        TipoDinero other = (TipoDinero) object;
        if ((this.idTipoDinero == null && other.idTipoDinero != null) || (this.idTipoDinero != null && !this.idTipoDinero.equals(other.idTipoDinero))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.engagesoft.cashflow.entidades.TipoDinero[ idTipoDinero=" + idTipoDinero + " ]";
    }
    
}
